
/**
 *  设置控制器中的键盘与控件间的间距
 *
 *  @param spacing 键盘与TextField之间的距离
 */
#import "PywKeyboardManager.h"
#define KeyBoardHelper(spacing) {\
BOOL _wasKeyBoardManagerEnabled;\
}\
- (void)viewDidAppear:(BOOL)animated{\
[super viewDidAppear:animated];\
_wasKeyBoardManagerEnabled = [[IQKeyboardManager sharedManager] isEnabled];\
[[IQKeyboardManager sharedManager] setEnable:YES];\
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO];\
[[IQKeyboardManager sharedManager] setShouldResignOnTouchOutside:YES];\
[[IQKeyboardManager sharedManager] setKeyboardDistanceFromTextField:spacing];\
}\
- (void)viewWillDisappear:(BOOL)animated{\
[super viewWillDisappear:animated];\
[[IQKeyboardManager sharedManager] setEnable:_wasKeyBoardManagerEnabled];\
}
/**
 *  调节字体大小
 *
 *  @param fontSize 传入的字体大小
 *
 *  @return 不同设备上的字体大小
 */
#define adjuctFont(size) - (CGFloat)adjuctFont:(CGFloat)size{\
CGFloat width = [UIScreen mainScreen].bounds.size.width;\
CGFloat height = [UIScreen mainScreen].bounds.size.height;\
if (width < height) {\
    fontSize = (width / 320) * fontSize;\
}else{\
    fontSize = (width / 568) * fontSize;\
}\
return (int)(fontSize + 0.5);\
}\
